package com.itheima.Test3;

public class RandomNumHandlerDemo {
    public static void main(String[] args) {
        useRandNumHandler(new RandomNumHandler() {
            @Override
            public String getNumber() {
                String result ="奥特曼";
                return result;
            }
        });

        useRandNumHandler(()->{
            String result ="奥特曼";
            return result;
        });
    }
    public static void  useRandNumHandler(RandomNumHandler r){
        String result =r.getNumber();
       System.out.println(result);
    }
}

interface RandomNumHandler{
    String getNumber();
}